<template>
  <div>
    <div class="f-16 c_text2 mb-16 fw-6">对话规则</div>
    <div class="wrap">
      <div class="block">
        <div class="left"><el-switch size="small" /></div>
        <div class="right">
          <span class="title">超时提醒</span>
          <div class="row-item">客服没有在<el-input size="small" class="input" :disabled="!blockStatus" />分钟内及时回复用户消息则为超时</div>
          <div class="row-item">对话超时前<el-input size="small" class="input" :disabled="!blockStatus"/>分钟开始进入超时倒计时</div>
          <div class="bts">
            <div class="flex-btn" v-if="blockStatus">
              <div @click.stop='onTiggerBockOne(false)'>取消</div>
              <div @click.stop='onTiggerBockOne(false)'>保存</div>
            </div>
            <div class="flex-btn" v-else>
              <div @click='onTiggerBockOne(true)'>修改</div>
            </div>
          </div>
        </div>
      </div>
      <div class="block">
        <div class="right">
          <span class="title">自动结束对话</span>
          <div class="row-item">客服发出消息<el-input size="small" class="input" :disabled="!blockTwo" />分钟后未收到任何回复自动结束对话</div>
          <div class="bts">
            <div class="flex-btn" v-if="blockTwo">
              <div @click.stop='onTiggerBockTwo(false)'>取消</div>
              <div @click.stop='onTiggerBockTwo(false)'>保存</div>
            </div>
            <div class="flex-btn" v-else>
              <div @click='onTiggerBockTwo(true)'>修改</div>
            </div>
          </div>
        </div>
      </div>
      <div class="block">
        <div class="right">
          <span class="title">自动清理结束对话</span>
          <div class="row-item">会话结束<el-input size="small" class="input" :disabled="!blockThree" />分钟后自动清理</div>
          <div class="bts">
            <div class="flex-btn" v-if="blockThree">
              <div @click.stop='onTiggerBockThree(false)'>取消</div>
              <div @click.stop='onTiggerBockThree(false)'>保存</div>
            </div>
            <div class="flex-btn" v-else>
              <div @click='onTiggerBockThree(true)'>修改</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      switchType: false,
      blockStatus: false,
      blockTwo: false,
      blockThree: false
    };
  },
  methods: {
    onTiggerBockOne(status) {
      this.blockStatus = status
    },
    onTiggerBockTwo(status) {
      this.blockTwo = status
    },
    onTiggerBockThree(status) {
      this.blockThree = status
    }
  },
};
</script>
<style lang="scss" scoped>
.wrap {
  .block {
    position: relative;
    padding: 16px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    margin-bottom: 16px;
    display: flex;
    .left {
      margin-right: 20px;
    }
    .right {
      .title {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: rgba(0, 0, 0, .85);
        line-height: 22px;
        margin-bottom: 12px;
      }
      .row-item {
        display: flex;
        align-items: center;
        color: rgba(0, 0, 0, .65);
        font-size: 14px;
        margin-bottom: 20px;
        .input {
          width: 100px;
          margin: 0 4px;
        }
      }
      .bts {
        position: absolute;
        right: 16px;
        top: 16px;
        .flex-btn {
          display: flex;
          align-items: center;
          div {
            display: block;
            color: #3070ff;
            cursor: pointer;
            font-size: 14px;
            line-height: 22px;
            &:not(:first-child) {
              margin-left: 14px;
            }
          }
        }
      }
    }
  }
}
</style>